home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DeveloperStax.cpt / Developer Stack 1.1 / card_20943.txt < prev    next >
Text File  |  1989-02-26  |  2KB  |  63 lines

  1. -- card: 20943 from stack: in.1
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 13187
  5. -- name: ReturnkeyInField
  6.  
  7.  
  8. -- part contents for background part 4
  9. ----- text -----
  10. 5
  11.  
  12. -- part contents for background part 2
  13. ----- text -----
  14. ReturnkeyInField
  15.  
  16. -- part contents for background part 3
  17. ----- text -----
  18. --
  19. --This will capture the return key when it is pressed in the active field.
  20. --Each line of code is explained directly beneath it.
  21. --Created 1/7/88 by Steve Drazga, ART Incorporated
  22. --This script segment may be put into the card, background, or stack scripts.
  23. --To make it work, the fields should pass the global variables
  24. --'currentfield', and 'nextfield'
  25. --
  26.  
  27. on idle
  28.   --
  29.   global currentfield,nextfield
  30.   --
  31.   --currentfield contains the name of the currently active field
  32.   --next field contains the name of the field that the user will
  33.   --go to when he presses the return key
  34.   --
  35.   if currentfield is empty then exit idle
  36.   --
  37.   --if the currentfield is empty then we don't want to do anything
  38.   --
  39.   if last char of field currentfield is return then
  40.     --
  41.     --if the user has pressed return then we will execute the following:
  42.     --
  43.     delete last char of field currentfield
  44.     --
  45.     --first we get rid of the return character
  46.     --
  47.     put rect of field nextfield into it
  48.     put item 1 of it into leftSide
  49.     put item 2 of it into top
  50.     --
  51.     --then we get the coordinates of the next field in line so that
  52.     --we can select the entire contents.
  53.     --
  54.     click at leftside,top+5 with shiftkey
  55.     --
  56.     --we now select the contents of the next field
  57.     --
  58.   end if
  59.   pass idle
  60.   --
  61.   --always pass the idle up through the hiearchy
  62.   --
  63. end idle